package com.imau.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

@TableName("t_role")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Role implements Serializable {
    @TableField(exist=false)
    private static final long serialVersionUID = 594829320797158219L;

    @TableId(type= IdType.ASSIGN_ID)
    private String id;
    /**
     * 角色名
     */
    private String name;
    /**
     * 说明
     */
    private String description;

    @TableField(exist=false)
    private Set<User> users = new HashSet<User>(0); //角色与用户多对多

    @TableField(exist=false)
    private Set<Permission> permissions = new HashSet<Permission>(0);//角色与模块  多对多


}